

const userMap = {
  '0': {
    code: 1,
    user_id: '1',
    type: '0'
  },
  '1': {
    code: 1,
    user_id: '1',
    type: '1'
  }
}

export default {
  login: config => {
    debugger;
    const { type, mobile, password } = JSON.parse(config.body)
    if(mobile == '18688656422' && password == '123456abc') {
      return userMap[type]
    } else {
      return {
        code: 0 ,
        msg : '用户不存在或者用户名密码错误'
      }
    }
  },
  getUserInfo: config => {
    const { token } = param2Obj(config.url)
    if (userMap[token]) {
      return userMap[token]
    } else {
      return false
    }
  },
  logout: () => 'success'
}
